<?php if( ! defined('BASEPATH')) exit('No direct script access allowed');

class Logout extends CI_Controller{
	var $_public_view;

	function __construct(){
		parent::__construct();
		$this->load->model('model_perjalanan', 'mtrip');
		$this->load->helper('url');
        $this->load->library('session');
        $this->config->load('ojexcom');
        $this->_public_view = $this->config->item('public_view');
	}

	function index(){
		$this->session->unset_userdata('isLogin');  //unset session
		$this->session->unset_userdata('username'); 
		$this->session->unset_userdata('user_id'); 
        $this->session->unset_userdata('page'); 
        
        //data yang akan ditampilkan
        $data = array('page_content' => 'home',
                'page_title' => 'O-JEX',
                'pengemudi' => $this->mtrip->get_pengemudi(),
            'penumpang' => $this->mtrip->get_penumpang(),
                'isLogin' => $this->session->userdata('isLogin'),
                'user' => $this->session->userdata('username'),
                );
        $this->load->view($this->_public_view, $data);  //tampilkan datanya
	}
}